package com.upcode.weighing.enums;


import java.util.Objects;

/**
 * 机构状态枚举
 */
public enum PayChannelEnum {

    CASH(1,"现金"),
    ALI_PAY(2,"支付宝"),
    WE_CHAT(3,"微信"),
    TRANSFER(4,"转账"),
    POS(5,"POS 机");

    private Integer value;
    private String msg;

    PayChannelEnum(Integer value, String dec) {
        this.value = value;
        this.msg = dec;
    }

    public Integer getValue() {
        return value;
    }

    public String getMsg() {
        return msg;
    }

    public static Integer getValue(Integer value) {
        if (Objects.isNull(value)) {
            return null;
        }
        for (PayChannelEnum u : PayChannelEnum.values()) {
            if (u.getValue().equals(value)) {
                return u.getValue();
            }
        }
        return null;
    }
}
